$(function(){

		$( "#tabs" ).tabs();
		$( ".tabs-bottom .ui-tabs-nav, .tabs-bottom .ui-tabs-nav > *" )
			.removeClass( "ui-corner-all ui-corner-top" )
			.addClass( "ui-corner-bottom" );

var previousHash = location.hash;

// Set previous hash.
previousHash = ( previousHash.replace( /^#/, '' ) || 'blank' );

$(window).hashchange( function(){
var hash = location.hash;

// Set the page title based on the hash.
var currentHash = ( hash.replace( /^#/, '' ) || 'blank' );
switch(currentHash)
{
case 'blank':
  //execute code block 1
  if (previousHash == 'register')
  {
        $("#dialog-box-registration").dialog('close');
        previousHash = currentHash;
    
  }
  else if (previousHash == 'login')
  {
        $("#dialog-box-login").dialog('close');
        previousHash = currentHash;
  }

  break;
case 'register':

        if (previousHash == 'blank')
        {

        $("#dialog-box-registration").dialog('open');
        previousHash = currentHash;
      
        }
        else if (previousHash == 'login')
            {
                 $("#dialog-box-login").dialog('close');
               $("#dialog-box-registration").dialog('open');
        previousHash = currentHash;
            }
  break;
  case 'login':

        if (previousHash == 'blank')
        {

        $("#dialog-box-login").dialog('open');
        previousHash = currentHash;

        }
        else if (previousHash == 'registration')
            {
                 $("#dialog-box-registration").dialog('close');
               $("#dialog-box-login").dialog('open');
        previousHash = currentHash;
            }
  break;
default:
 // code to be executed if n is different from case 1 and 2
}

});


  $('.dazzler_login_link').click(function(event){
    //event.preventDefault();
    $("#dialog-box-login").dialog('open');
  });

});